<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>zxt</title>
    <style>
        #box {
            width: 800px;
            height: 400px;
            border: 1px solid red;
            margin: 20px auto;
        }
    </style>
</head>

<body>
    <div id="box">

    </div>
</body>
<!-- 引入echarts -->
<script src="./a//echarts.min.js"></script>
<script>
    // 获取box
    const mycharts = document.querySelector('#box')

    // 初始化echarts
    const charts = echarts.init(mycharts)

    // 配置图表数据
    const option = {
        xAxis: {
            type: 'category',
            data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
            type: 'value'
        },
        series: [{
            data: [
                120,
                {
                    value: 200,
                    itemStyle: {
                        color: '#a90000'
                    }
                },
                150,
                80,
                70,
                110,
                130
            ],
            type: 'bar'
        }]
    };

    // 渲染生成图表
    charts.setOption(option)
</script>

</html>